package com.easylinkin.linkappapi.device.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.easylinkin.linkappapi.device.entity.Device;
import com.easylinkin.linkappapi.device.entity.DeviceModel;
import com.easylinkin.linkappapi.device.entity.DeviceModelDto;
import com.easylinkin.linkappapi.device.entity.vo.DeviceModelQueryVo;
import java.util.List;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author TongJie
 * @since 2020-04-14
 */
public interface DeviceModelMapper extends BaseMapper<DeviceModel> {

  /**
   * 查询设备
   */
  List<DeviceModel> selectDevicesByModelId(@Param("modelId") Integer modelId,@Param("tenantId")String tenantId);


  void deleteByCodes(@Param("deviceCodes") List<String> deviceCodes);

  void deleteByCondition(DeviceModelDto deviceModelDto);

  List<DeviceModel> selectByTenantIdAndIsRemove(@Param("tenantId")String tenantId, @Param("isRemove")int isRemove);

  void deleteAreaByAreaId(@Param("environmentalAreaId") Integer environmentalAreaId,@Param("modelId") Integer modelId,@Param("tenantId") String tenantId);

  DeviceModel findOne(@Param("modelId") Integer modelId,@Param("tenantId") String tenantId,@Param("code") String code);

  List<DeviceModelDto> selectModelDeviceByArea(@Param("device") DeviceModelQueryVo device);
}
